package com.model.dao;

// Generated Sep 16, 2013 2:49:26 PM by Hibernate Tools 4.0.0

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * InventoryTable generated by hbm2java
 */
@Entity
@Table(name = "inventory_table", catalog = "shoppingcart_schema")
public class InventoryTable implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -990938309905357121L;
	private int itemId;
	private ChildcatalogTable childcatalogTable;
	private int itemQty;
	private String itemLocation;

	public InventoryTable() {
	}

	public InventoryTable(ChildcatalogTable childcatalogTable, int itemQty) {
		this.childcatalogTable = childcatalogTable;
		this.itemQty = itemQty;
	}

	public InventoryTable(ChildcatalogTable childcatalogTable, int itemQty,
			String itemLocation) {
		this.childcatalogTable = childcatalogTable;
		this.itemQty = itemQty;
		this.itemLocation = itemLocation;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "childcatalogTable"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "item_Id", unique = true, nullable = false)
	public int getItemId() {
		return this.itemId;
	}

	public void setItemId(int itemId) {
		this.itemId = itemId;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public ChildcatalogTable getChildcatalogTable() {
		return this.childcatalogTable;
	}

	public void setChildcatalogTable(ChildcatalogTable childcatalogTable) {
		this.childcatalogTable = childcatalogTable;
	}

	@Column(name = "item_qty", nullable = false)
	public int getItemQty() {
		return this.itemQty;
	}

	public void setItemQty(int itemQty) {
		this.itemQty = itemQty;
	}

	@Column(name = "item_location", length = 45)
	public String getItemLocation() {
		return this.itemLocation;
	}

	public void setItemLocation(String itemLocation) {
		this.itemLocation = itemLocation;
	}

}
